package com.zlt.miaosha.access;

import com.zlt.miaosha.domain.MiaoshaUser;

public class UserContext {

	/**
	 * threadlocal保存当前线程
	 */
	private static ThreadLocal<MiaoshaUser> userHolder = new ThreadLocal<MiaoshaUser>();
	
	public static void setUser(MiaoshaUser user) {
		userHolder.set(user);
	}
	
	public static MiaoshaUser getUser() {
		return userHolder.get();
	}

}
